
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">

    <title>图片列表</title>

    <!-- 加载 CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
     <link href="/homes/css/app.css" rel="stylesheet">

      <!-- 加载 js -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery.imagesloaded/4.0.0/imagesloaded.pkgd.min.js"></script>
</head>
<body>

    <!-- bootstrap 导航条 -->
    <nav class="navbar navbar-default">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <!-- LOGO 首页跳转按钮 -->
          <a class="navbar-brand" href="http://l.com/albums">Laravel Album</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <!-- 导航按钮 此网站不需要 -->
            <!-- <li><a href="#">Link</a></li> -->
          </ul>
        </div>
      </div>
    </nav>

    <!-- bootstrap 容器 -->
    <div class="container">
        <!-- 显示提示消息 -->
                <!-- 网站主体内容 -->
        
<!-- 相册信息 选着一个相册出现的信息 一下信息-->
<div class="row">
    <div class="col-sm-3">
                    <img class="img-responsive" src="{{$user['img']}}">
            </div>
    <div class="col-sm-9">
        <h2>{{$user['name']}}</h2>
        <p>{{$user['intro']}}</p>

        <!-- 上传照片：弹出框按钮 -->
         <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#uploadPhoto">
          上传照片
        </button>
    </div>
</div>
<!-- 上传照片：弹出框 -->
<div class="modal fade" id="uploadPhoto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">上传照片</h4>
      </div>
      <div class="modal-body">
          <form action="/dolist" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">
            <input type="hidden" name="album_id" value="{{$user['id']}}">

    <div class="form-group">
      <input type="file" name="photo" multiple="multiple"   required>
    </div>

            <div class="form-group">
                <input type="text" class="form-control" name="name" placeholder="Click here to add a title for this photo">
            </div>
            <div class="form-group">
                <input type="text" class="form-control" name="intro" placeholder="Click here to add an introduction for this photo">
            </div>
             {{csrf_field()}}
            <button type="submit" class="btn btn-primary">上传</button>
          </form>
      </div>
    </div>
  </div>
</div>

<!-- 编辑相册：弹出框 -->
<div class="modal fade" id="editAlbum" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">编辑相册</h4>
      </div>
      <div class="modal-body">
      <!-- //多文件 -->
          <form class="form-horizontal" action="/bianji/{{$user['id']}}" method="post"  enctype="multipart/form-data">


            <input type="hidden" name="_token" value="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">
            <input type="hidden" name="_method" value="PUT">
            <div class="form-group">
              <label for="name" class="col-sm-2 control-label">编辑相册名</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="name" name="name" required value="风景">
              </div>
            </div>
            <div class="form-group">
              <label for="intro" class="col-sm-2 control-label">编辑相册简介</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="intro" name="intro" value="风景">
              </div>
            </div>

            <!-- 封面图片上传接口 -->
              <div class="form-group">
                <label for="intro" class="col-sm-2 control-label">Cover picture</label>
                <div class="col-sm-10">
                  <input type="file" name="img" value="">
                </div>
            </div>
            {{csrf_field()}}
          </form>
      </div>
    </div>
  </div>
</div>


<!-- 删除相册：弹出框 -->



<!-- 照片显示 -->
<div></div>



<div class="row  masonry">
    <div class="col-md-3 col-sm-4 photo  item">
    <div class="panel panel-default">
    @foreach ($photos as $v)
      <div class="panel-body" >
        <img class="img-responsive" src="{!! $v->src !!}">
                <!-- 编辑照片：弹出框按钮 -->
      
      </div>
      @endforeach
    </div>
</div>
</div>

<!-- 编辑照片：弹出框 -->
<div class="modal fade" id="editPhoto44" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">编译图片</h4>
      </div>
      <div class="modal-body">
          <form action="/bianjizp/{{$user['id']}}" method="post">
            <input type="hidden" name="_token" value="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">
            <input type="hidden" name="_method" value="PUT">
            <div class="form-group">
                <input type="text" class="form-control" name="name" value="photo544timg.jpg" placeholder="Click here to add a title to this photo">
            </div>
            <div class="form-group">
                <input type="text" class="form-control" name="intro" value="" placeholder="Click here to add an introduction to this photo">
            </div>
            {{csrf_field()}}
            <button type="submit" class="btn btn-primary">编译</button>
          </form>
          <form action="/bianjizp/{{$user['id']}}" method="post" style="float:right;position:relative;top:-35px">
            <input type="hidden" name="_token" value="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">

            <input type="hidden" name="_method" value="DELETE">
            {{csrf_field()}}
            <button type="submit" class="btn btn-danger">删除</button>
          </form>

      </div>
    </div>
  </div>
</div>




<!--瀑布流-->
<script>
 var container = $('.masonry');
  container.imagesLoaded(function() {
    container.masonry({
    itemSelector: '.item',
    isAnimated: true,
    });
});

</script>

    </div>

   
</body>
</html>
